-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dmd: bootstrap from source #324982
base: master
Are you sure you want to change the base?
dmd: bootstrap from source #324982
Conversation
Currently stuck on #324961 |
Building the bootstrap package against 2.108.0 fails building the backend with the following error:
Building against 2.109.1 fails to link the dmd binary:
This could be caused by GDC apparently being broken when linking in C/C++ libraries: Another thing I found was this note in GCC's package. nixpkgs/pkgs/development/compilers/gcc/default.nix Lines 233 to 235 in 85a1351
These lines were added in commit cb4e7fd from #174125, which is related to #241341, which was fixed in #241628. #261947 is meant to fix a lot of these issues with the GDC package, but it's stalled so I think we've hit a dead end for now. I'll look into this a bit later. |
It might be easier to go with LDC since it's already used at dlang.nix and is better up to date. It currently isn't bootstrapping either in Nixpkgs, but the compiler does support that. And we'll get another perk switching compilers even before bootstrapping is supported: DMD gets optimised better and thus is faster for the user. |
Sounds good, I'll try that later |
Bootstrapping from LDC worked, thanks @dukc! |
But isn't LDC itself bootstrapped from an older LDC binary? |
Ah right, do you know if there's a tag of LDC without D we could build from? I think I remember one but I can't find it. |
Yes, Note that this was a while ago, so a few interim versions may be required to bootstrap all the way to the latest compiler versions. |
Awesome, thanks. I'll try building from 0.17; the wiki page for building LDC says that 0.17 can be used for bootstrapping, and by the looks |
The latest LLVM supported by LDC 0.17 is LLVM 6, which was removed a while ago. Trying to bootstrap from the |
I'm a bit stuck here, I've just realised that DMD can only generate code for x86 CPUs which won't work for all platforms. On the other hand LDC 0.17 won't compile because it's too old. The |
Honestly not sure, sorry. I opened an LDC issue for you but I can't tell you whether the maintainers will want to support this case. If not, I quess it's either back to gdc bootstrap (possibly still easier to do via intermediate LDC versions though) or readding support for older LLVM modules. I honestly don't know which is easier and I won't hold it on you if you decide it's not worth the effort. Regardless of what happens, I suggest committing the LDC compilation for dmd, because it means DMD is faster. |
I think both GDC and LDC are not worth the hassle anymore. Starting from DMD is still an option though (about optimizing DMD using LDC, we can still build the final DMD using the final LDC). It sounds like a bit of a mess but I think it can be done as long as 095ba4f is reverted. |
Description of changes
Bootstrap DMD from source (previously using GDC).
Supersedes #317845
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.